<?php 
namespace App\Http\Controllers\Sendmail;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Input;

class SendmailController extends Controller{



	//分页展示
	public function index(){

			$data=DB::table('goods')->get();

			return view('sendmail.index',['data'=>$data]);
       
    }

    
    public function content(){

       return view('sendmail.content');
    }




    public function book(Request $request){
        if($request->isMethod('post')){
            $data =Input::all();
            $name=$data['name'];
            $tel=$data['tel'];
            unset($data['_token']);
           $res = DB::table('cart')->insert(['name' =>$name,'tel' => $tel]);
          echo '购买成功';
        }else{
            return view('sendmail.book');
        }

       
    }

    





    public function list(){

       $data=DB::table('goods')->get();
       return view('sendmail.list',['data'=>$data]);
    }

    public function news_list(){

       return view('sendmail.news_list');
    }

    
    public function pro_detail(){

       return view('sendmail.pro_detail');
    }

}

?>